package com.tanhan.mindapp.dao;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tanhan.mindapp.dao.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName("sys_user")
@Schema(description = "系统用户实体类")
public class SysUser extends BaseEntity {
    private static final long serialVersionUID = 1L;

    // 用户账号
    @TableField("user_name")
    @Schema(description = "用户账号", example = "admin")
    private String userName;

    // 用户昵称
    @TableField("nick_name")
    @Schema(description = "用户昵称", example = "管理员")
    private String nickName;

    // 用户邮箱
    @TableField("email")
    @Schema(description = "用户邮箱", example = "admin@example.com")
    private String email;

    // 手机号码
    @TableField("phone")
    @Schema(description = "手机号码", example = "13800138000")
    private String phone;

    // 密码
    @TableField("password")
    @Schema(description = "密码",example = "123456")
    private String password;

    // 帐号状态（0正常 1停用）
    @TableField("status")
    @Schema(description = "帐号状态", example = "0", allowableValues = {"0", "1"})
    private String status;

    // 最后登录IP
    @TableField("login_ip")
    @Schema(description = "最后登录IP", example = "192.168.1.100")
    private String loginIp;

    // 最后登录时间
    @TableField("login_date")
    @Schema(description = "最后登录时间", example = "2023-01-01 12:00:00")
    private Date loginDate;

    // 角色列表字段
    @TableField(exist = false)
    @Schema(description = "用户角色列表")
    private List<SysRole> roles;
}
